package cn.jiyun.service.impl;

import cn.jiyun.mapper.XxbMapper;
import cn.jiyun.pojo.Xxb;
import cn.jiyun.service.XxbService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XxbServiceImpl implements XxbService {
    @Autowired
    XxbMapper xxbMapper;

    @Override
    public PageInfo<Xxb> findall(Xxb xxb, Integer page, Integer size) {
        PageHelper.startPage(page,size);
        List<Xxb> list =xxbMapper.findall(xxb);
        PageInfo<Xxb> xxbPageInfo = new PageInfo<>(list);
        return xxbPageInfo;
    }

    @Override
    public Xxb add(Xxb xxb) {
        return xxbMapper.add(xxb);
    }

    @Override
    public Xxb update(Integer id) {
        return xxbMapper.update(id);
    }

    @Override
    public Xxb updatexg(Xxb xxb) {
        return xxbMapper.updatexg(xxb);
    }

    @Override
    public Xxb delete(Integer id) {
        return xxbMapper.delete(id);
    }

    @Override
    public List<Xxb> find() {
        return xxbMapper.find();
    }

    @Override
    public Xxb hf(Integer id) {
        return xxbMapper.hf(id);
    }

    @Override
    public Integer hfss(Integer id) {
        return xxbMapper.hfss(id);
    }
}
